home *** CD-ROM | disk | FTP | other *** search
/ Digital Information Mana…ntial Guide to Multimedia / Digital Information Management - An Essential Guide to Multimedia.iso / Portable / PortableOpenOfficeCode / PortableOpenOfficeApp.nsi < prev    next >
Text File  |  2006-05-16  |  3KB  |  107 lines

  1. ;Copyright (C) 2004-2005 John T. Haller
  2. ;Additional Ideas from tracon and mai9
  3.  
  4. ;Website: http://portableapps.com/portableopenoffice
  5.  
  6. ;This software is OSI Certified Open Source Software.
  7. ;OSI Certified is a certification mark of the Open Source Initiative.
  8.  
  9. ;This program is free software; you can redistribute it and/or
  10. ;modify it under the terms of the GNU General Public License
  11. ;as published by the Free Software Foundation; either version 2
  12. ;of the License, or (at your option) any later version.
  13.  
  14. ;This program is distributed in the hope that it will be useful,
  15. ;but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. ;GNU General Public License for more details.
  18.  
  19. ;You should have received a copy of the GNU General Public License
  20. ;along with this program; if not, write to the Free Software
  21. ;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  22.  
  23. !define NAME "PortableOpenOfficeMath"
  24. !define FRIENDLYNAME "Portable OpenOffice.org Math"
  25. !define APP "OpenOfficeMath"
  26. !define VER "1.1.3.0"
  27. !define WEBSITE "portableapps.com/portableopenoffice"
  28. !define EXECTHIS "PortableOpenOffice.exe -math"
  29.  
  30. ;=== Program Details
  31. Name "${NAME}"
  32. OutFile "${NAME}.exe"
  33. Caption "${FRIENDLYNAME} - the complete office suite that's completely portable"
  34. VIProductVersion "${VER}.0"
  35. VIAddVersionKey FileDescription "${FRIENDLYNAME}"
  36. VIAddVersionKey LegalCopyright "GPL"
  37. VIAddVersionKey Comments "Allows ${APP} to be run from a removable drive.  For additional details, visit ${WEBSITE}"
  38. VIAddVersionKey CompanyName "by John T. Haller et al"
  39. VIAddVersionKey OriginalFilename "${NAME}.exe"
  40. VIAddVersionKey FileVersion "${VER}"
  41.  
  42. ;=== Runtime Switches
  43. CRCCheck On
  44. WindowIcon Off
  45. SilentInstall Silent
  46. AutoCloseWindow True
  47.  
  48. ;=== Program Icon
  49. Icon "${APP}.ico"
  50.  
  51. Var EXECSTRING
  52.  
  53. Section "Main"
  54.     StrCpy $EXECSTRING "${EXECTHIS}"
  55.  
  56.     ;=== Get any passed parameters
  57.     Call GetParameters
  58.     Pop $0
  59.     StrCmp "'$0'" "''" "" LaunchProgramParameters
  60.  
  61.     ;=== No parameters
  62.     StrCpy $EXECSTRING `${EXECTHIS}`
  63.     Goto LaunchNow
  64.  
  65.     LaunchProgramParameters:
  66.         StrCpy $EXECSTRING `${EXECTHIS} $0`
  67.  
  68.     LaunchNow:
  69.         Exec $EXECSTRING
  70.  
  71. SectionEnd
  72.  
  73. Function "GetParameters"
  74.   Push $R0
  75.   Push $R1
  76.   Push $R2
  77.   StrCpy $R0 $CMDLINE 1
  78.   StrCpy $R1 '"'
  79.   StrCpy $R2 1
  80.   StrCmp $R0 '"' loop
  81.     StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
  82.   loop:
  83.     StrCpy $R0 $CMDLINE 1 $R2
  84.     StrCmp $R0 $R1 loop2
  85.     StrCmp $R0 "\" "" "nofile"
  86.       IntOp $2 $R2 + 1
  87.     nofile:
  88.     ;MessageBox MB_OK "r0: $R0"
  89.     StrCmp $R0 "" loop2
  90.     IntOp $R2 $R2 + 1
  91.     Goto loop
  92.   loop2:
  93.     IntOp $R0 $R2 - $2
  94.     IntOp $R0 $R0 - 4
  95.     ;MessageBox MB_OK "$R2 - $2 = $R0"
  96.     StrCpy $R7 $CMDLINE $R0 $2 ; we save the filename
  97.     ;MessageBox MB_OK "$2"
  98.   loop2b:
  99.     IntOp $R2 $R2 + 1
  100.     StrCpy $R0 $CMDLINE 1 $R2
  101.     ;MessageBox MB_OK "rr0: $R0"
  102.     StrCmp $R0 " " loop2b
  103.   StrCpy $R0 $CMDLINE "" $R2
  104.   Pop $R2
  105.   Pop $R1
  106.   Exch $R0
  107. FunctionEnd